package com.seari.service.impl;

import com.seari.mapper.DevCheckRepairMapper;
import com.seari.mapper.DevTaskMapper;
import com.seari.pojo.DevCheckRepairPlanPojo;
import com.seari.service.DevCheckRepairService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DevCheckRepairServiceImpl implements DevCheckRepairService {

    @Autowired
    private DevCheckRepairMapper devCheckRepairMapper;
    @Autowired
    private DevTaskMapper devTaskMapper;
    /**
     * 获取检修列表
     * @return
     */
    @Override
    public List<DevCheckRepairPlanPojo> getCheckRepairRecordList() {
        return devCheckRepairMapper.getCheckRepairRecordList();
    }

    /**
     * 新增、修改检修记录
     * @param checkRepairPojo
     */
    @Override
    public void addOrUpdateCheckRepairRecord(DevCheckRepairPlanPojo checkRepairPojo) {
        devTaskMapper.saveOrUpdateTask(checkRepairPojo.getTaskBean());
    }

    /**
     * 删除检修记录
     * @param taskNo
     */
    @Override
    public void deleteCheckRepairRecord(String taskNo) {
        devCheckRepairMapper.deleteCheckRepairRecord(taskNo);
    }

    /**
     * 批量删除记录
     * @param taskNoArr
     */
    @Override
    public void deleteCheckRepairByNos(String[] taskNoArr) {
        devCheckRepairMapper.deleteCheckRepairByNos(taskNoArr);
    }
}
